import React from 'react';

import classNames from 'classnames';
import styles from './RequireLabel.module.less';

interface RequireLabelProps {
  required?: boolean;
  withAsterisk?: boolean;
  label: any;
}
export const NRequireLabel = React.memo(({ required, withAsterisk, label }: RequireLabelProps) => {
  {
    return (
      <div className={classNames(styles['label-wrap'])}>
        {required && withAsterisk !== false ? <span className={classNames(styles['required'])}>*</span> : ''}
        <span className={classNames(styles['label-txt'])}>{label}</span>
      </div>
    );
  }
});
